POV-Ray : Newsgroups : povray.unofficial.patches : Getting Function Evaluation : Re: Getting Function Evaluation Server Time
1 Sep 2024 18:13:11 EDT (-0400)
  Re: Getting Function Evaluation  
From: Geoff Wedig
Date: 19 Dec 2000 10:19:11
Message: <3a3f7c6f@news.povray.org>
Chris Huff <chr### [at] maccom> wrote:

> In article <3a3e0bb8@news.povray.org>, Geoff Wedig 
> <wed### [at] darwinepbicwruedu> wrote:

>> No, it gave me an error.  I don't have the code here, so I can't tell 
>> what error it was, but once I saw that, I began to wonder what 
>> eval_pattern() was for in the first place, since it wasn't for that.

> The eval_pattern() function returns the float value of a pattern at a 
> specific point...for a function pattern, this should be the result of 
> evaluating the function at that point, at least as long as the result is 
> in the 0-1 range and you don't have any special waveforms, 
> transformations, or warps applied. If you post the problem code I will 
> try to figure out what's wrong...
> Something like this macro *should* work for most cases:
> #macro Eval_Func(Func, X, Y, Z)
>     eval_pattern(function {Func}, < X, Y, Z>)
> #end
> Of course, that could also be written:
> #macro Eval_Func(Func, Pt)
>     eval_pattern(function {Func}, Pt)
> #end
> Where Pt is a 3D vector.

What you wrote works, but if you have:

#declare test_function = function { Func }

eval_pattern(test_function, Pt)

I get the following:  "error: numeric expression expected but func_id found
instead."

So it sortof works.

Geoff


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.